#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int N = 1e3 + 10;
int n;
typedef struct
{
	int x, y;
}S;
S s[N];
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		s[i].x = c - a;
		s[i].y = d - b;
	}
	int a1, b1, c1, d1;
	cin >> a1 >> b1 >> c1 >> d1;
	int e1 = c1 - a1;
	int e2 = d1 - b1;
	for (int i = 0; i < n - 1; i++) {
		for (int j = i + 1; j < n; j++) {
			int k = s[i].x + s[j].x;
			int k1 = s[i].y + s[j].y;
			if (e1 * k1 == k * e2) {
				cout << "YES" << endl;
				return 0;
			}
		}
	}
	cout << "NO" << endl;
	return 0;
}